package com.boang.bt;

import java.io.*;

/*
  @author: 13813
  @date: 2024/12/12 15:16
*/
public class FileInputOutputDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fileInputStream = new FileInputStream("C:\\Users\\13813\\Desktop\\campus-market.zip");
        BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);

        FileOutputStream fileOutputStream = new FileOutputStream("C:\\Users\\13813\\Desktop\\campus-market11.zip");
        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(fileOutputStream);


        long start = System.currentTimeMillis();

        int i = 0;

        while ((i = bufferedInputStream.read()) != -1) {
            bufferedOutputStream.write(i);
        }

        fileInputStream.close();
        fileOutputStream.close();

        long end = System.currentTimeMillis();

        System.out.println((end - start) / 1000);
    }
}
